﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LeandroPrado.FluentNHibernate.Domain.Entidades;
using FluentNHibernate.Mapping;

namespace LeandroPrado.FluentNHibernate.Domain.Mapeamento
{
    public class TelefoneMap : ClassMap<Telefone>
    {
        public TelefoneMap()
        {
            Id(x => x.Codigo).GeneratedBy.Identity();

            Map(x => x.CodigoDdd)
                .Not.Nullable()
                .Length(255);

            Map(x => x.Numero)
                .Not.Nullable();

            References(x => x.Pessoa);
        }
    }
}